function check() {
    var status = $("select[name=status] option:selected").val();
    var note = $("textarea[name=note]").val();
    if (status == 2 && note == '') {
        layer.alert('请填入不通过原因', {icon: 5});
        return false;
    }
}
someoneCallback = function(){
    var show_img = this.wrapperDom.find(".show_img");
    var path =  '/storage/' + this.savedPath;
    show_img.attr('src', path);
}
// success(callback)中声名的回调方法需在此定义，参数callback可为任意名称，此方法将会在上传完成后被调用
// 可使用this对象获得fileName,fileSize,uploadBaseName,uploadExt,subDir,group,savedPath等属性的值
someCallback = function () {
    if (this.group == 'model') {
        $("input[name=filesize]").val(parseFloat(this.fileSize / (1000 * 1000)).toFixed(2) + 'MB');
        return;
    }
    var show_img = this.wrapperDom.find(".show_img");
    var savedpath = this.wrapperDom.find("#savedpaththumb");
    var path =  this.savedPath;

    var id = $("input[name='id']").val();
    $.ajax({
        url: "/backend/makeonethumb",
        type: "POST",
        data: {'id':id,'path':path},
        async: false,
        success: function (res) {
            var path = '/storage/' + res;
            show_img.attr('src', path);
            savedpath.val(res);
        }
    })
}

$('.catsshow').change(function () {
    var id = $(".catsshow option:selected").val();
    $(".catrow").hide();
    $('.cats2show' + id).show();
    $("select[name='cat_id2']").val($('.cats2show'+id+' select option').first().val());
});
var changeCatid = function (value) {
    $("select[name='cat_id2']").val(value);
}

//相册弹出层
var showImgs = function (id) {
    $.getJSON('/backend/modelimages/' + id, function (json) {
        layer.photos({
            photos: json
            , shift: 0 //0-6的选择，指定弹出图片动画类型，默认随机
        });
    });
}

var delImg = function (a) {
    // $(a).parents("#aetherupload-wrapper").find("input[name='image']").val('');
    $(a).parents("#aetherupload-wrapper").find("#savedpath").val('');
    $(a).parents("#aetherupload-wrapper").find("#savedpaththumb").val('');
    $(a).next().attr('src', 'http://www.jishe.com/imagecache/large/images/default.png');
}